package com.neusoft.ysu.npms.controller;


import com.neusoft.ysu.npms.pojo.Department;
import com.neusoft.ysu.npms.pojo.Help;
import com.neusoft.ysu.npms.pojo.Result;
import com.neusoft.ysu.npms.service.IDepartmentService;
import com.neusoft.ysu.npms.service.IHelpService;
import com.neusoft.ysu.npms.service.IHelpmanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者：刘金秋
 * @since 2024-06-18
 */
@RestController
@RequestMapping("/help")
public class HelpController {
    @Autowired
    IHelpService helpService;

    @RequestMapping("/add")
    public Result add(@RequestBody Help help) {
//        System.out.println(department);
        helpService.add(help);
        return Result.success();
    }
    @RequestMapping("/delete")
    public Result deleteHelp(@RequestBody Help help) {
//        System.out.println(department);
        helpService.deleteHelp(help);
        return Result.success();
    }
    @RequestMapping("/update")
    public Result updateHelp(@RequestBody Help help){
        helpService.updateHelp(help);
        return Result.success();
    }

    @RequestMapping("getAll")
    public Result getAll(){
        helpService.selectAll();
        return Result.success();
    }

    @RequestMapping("findone")
    public Result findone(@RequestBody Help help){
        System.out.println(help);
        helpService.findById(help);
        return Result.success();
    }
}
